//
//  CardViewController.m
//  XiangCaoJiaYuan
//
//  Created by long Kan on 17/10/18.
//  Copyright © 2017年 tongj. All rights reserved.
//

#import "CardViewController.h"
#import "ListpViewController.h"
@interface CardViewController ()

@end

@implementation CardViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"我的工卡";
    UIButton *backbutton = [[UIButton alloc]initWithFrame:CGRectMake(10, 20, 15, 25)];
    [backbutton setBackgroundImage:[UIImage imageNamed:@"香草园地-发布信息_03@2x"] forState:UIControlStateNormal];
    [backbutton addTarget:self action:@selector(goBacktoUp) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *backItem = [[UIBarButtonItem alloc]initWithCustomView:backbutton];
    self.navigationItem.leftBarButtonItem = backItem;
    self.view.backgroundColor = HEXRGB(0x49ae72);
    [self view1];
}

-(void)goBacktoUp{
    [self.navigationController popViewControllerAnimated:YES];
}
-(void)view1{
   
    UIImageView *imagev = [[UIImageView alloc]initWithFrame:CGRectMake(25*WIDTH, 0, UIScreen_WIDTH-50*WIDTH, UIScreen_HEIGHT-100*HEIGHT)];
    imagev.userInteractionEnabled = YES;
    imagev.image = [UIImage imageNamed:@"timecard_bg_@3x"];
    [self.view addSubview:imagev];
    UIImageView *headimage = [[UIImageView alloc]initWithFrame:CGRectMake(UIScreen_WIDTH/2-(60*WIDTH), 260*HEIGHT, 80*WIDTH, 80*WIDTH)];
    headimage.userInteractionEnabled = YES;
    headimage.clipsToBounds = YES;
    headimage.layer.cornerRadius = 40*WIDTH;
    headimage.contentMode = UIViewContentModeScaleAspectFill;
    NSString *url = [USERDEFAULT objectForKey:@"head_image"];
     [headimage sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"icon_header_"]];
    [imagev addSubview:headimage];
    UILabel *label1 = [[UILabel alloc]initWithFrame:CGRectMake(45*WIDTH, 380*HEIGHT, 100, 20)];
    label1.text = @"工号";
    label1.textAlignment = NSTextAlignmentCenter;
    label1.textColor = HEXRGB(0xb1b1b1);
    [imagev addSubview:label1];
    UILabel *label2 = [[UILabel alloc]initWithFrame:CGRectMake(45*WIDTH, 420*HEIGHT, 100, 20)];
    label2.text = @"店铺名称";
    label2.textAlignment = NSTextAlignmentCenter;
    label2.textColor = HEXRGB(0xb1b1b1);
    [imagev addSubview:label2];
    UILabel *label3 = [[UILabel alloc]initWithFrame:CGRectMake(45*WIDTH, 460*HEIGHT, 100, 20)];
    label3.text = @"我的推荐";
    label3.textAlignment = NSTextAlignmentCenter;
    label3.textColor = HEXRGB(0xb1b1b1);
    [imagev addSubview:label3];
    
    UILabel *line1 = [[UILabel alloc]initWithFrame:CGRectMake(140*WIDTH, 400*HEIGHT, 140*WIDTH, 1)];
    line1.backgroundColor = HEXRGB(0xb1b1b1);
    [imagev addSubview:line1];
    UILabel *line2 = [[UILabel alloc]initWithFrame:CGRectMake(140*WIDTH, 440*HEIGHT, 140*WIDTH, 1)];
    line2.backgroundColor = HEXRGB(0xb1b1b1);
    [imagev addSubview:line2];
    UILabel *line3 = [[UILabel alloc]initWithFrame:CGRectMake(140*WIDTH, 480*HEIGHT, 140*WIDTH, 1)];
    line3.backgroundColor = HEXRGB(0xb1b1b1);
    [imagev addSubview:line3];
    
    UILabel *numb = [[UILabel alloc]initWithFrame:CGRectMake(140*WIDTH, 380*HEIGHT, 140*WIDTH, 20)];
    numb.text = @"9527";
    numb.textAlignment = NSTextAlignmentCenter;
    numb.textColor = HEXRGB(0x333333);
    [imagev addSubview:numb];
    UILabel *dian = [[UILabel alloc]initWithFrame:CGRectMake(140*WIDTH, 420*HEIGHT, 140*WIDTH, 20)];
    NSString *ou = [USERDEFAULT objectForKey:@"name"];
    dian.text = ou;
    dian.textAlignment = NSTextAlignmentCenter;
    dian.textColor = HEXRGB(0x333333);
    [imagev addSubview:dian];
    UIButton *people = [[UIButton alloc]initWithFrame:CGRectMake(140*WIDTH, 460*HEIGHT, 140*WIDTH, 20)];
    [people setTitle:@"5" forState:UIControlStateNormal];
    [people addTarget:self action:@selector(clickList) forControlEvents:UIControlEventTouchUpInside];
    [people setTitleColor:HEXRGB(0x33333) forState:UIControlStateNormal];
    [imagev addSubview:people];
    
    UIImageView *images = [[UIImageView alloc]initWithFrame:CGRectMake(120*WIDTH, 2.5*HEIGHT, 10*WIDTH, 15*HEIGHT)];
    images.image = [UIImage imageNamed:@"btn_arrows_nor"];
    [people addSubview:images];
}
-(void)clickList{
    ListpViewController *list = [[ListpViewController alloc]init];
    [self.navigationController pushViewController:list animated:YES];
}
@end
